package com.lx.api;

public class clonetest {
    public static void main(String[] args) throws CloneNotSupportedException {
        //浅拷贝
        int[] data = {1,2,3,4,5};
        User u1 = new User(1,"张三",data);
        User u2 = (User) u1.clone();
        data[0] = 10;
        u1.setName("李四");
        u1.setData(data);
        System.out.println(u1);
        System.out.println(u2);


    }
}
